<!DOCTYPE html>
<html lang="zh-cn">
<html>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="resources/js/jquery.min.js"></script>
<title>
   测试
</title>
<head>
</head>
<body>
hhhh我是测试
1）考虑1 － 9
个位数：全部都是1个
十位数：
2）考虑0

    1  2  3  4  5  6  7  8  9  0
10 11 12 13 14 15 16 17 18 19  1      19 div = 1 leavNum 9  1:1 + 10=11  2: 1 + 1  3: 1+1              18 1:1+9 。。。。。10   1:1 ＋ 1
20 21 22 23 24 25 26 27 28 29  2      29 div = 2 leavNum 9  1:1 + 10 + 1=12  2=1 + +1 + 10
30 31 32 33 34 35 36 37 38 39  3
...

80 81 82 83 84 85 86 87 88 89  8
90 91 92 93 94 95 96 97 98 99  9
</body>
<script>
    $(function () {
        demo(100);
        // alert("hhh");
    })
    /**
     * 测试1
     */
// 页面除以10的余数
    function demo(n) {
        // 计算0的个数
        var div = parseInt(n/10);
        var num_0 = div;
        var leavNumb = n%10;
        var  num_1 = 0;
        var  num_2 = 0;
        var  num_3 = 0;
        var  num_4 = 0;
        var  num_5 = 0;
        var  num_6 = 0;
        var  num_7 = 0;
        var  num_8 = 0;
        var  num_9 = 0;

        if(leavNumb == 1){
            num_1 = div + 1;
            num_2 = div;
            num_3 = div;
            num_4 = div;
            num_5 = div;
            num_6 = div;
            num_7 = div;
            num_8 = div;
            num_9 = div;
        }
        else if (leavNumb == 2){
            num_1 = div + 1;
            num_2 = div + 1;
            num_3 = div;
            num_4 = div;
            num_5 = div;
            num_6 = div;
            num_7 = div;
            num_8 = div;
            num_9 = div;
        }
        else if (leavNumb == 3){
            num_1 = div + 1;
            num_2 = div + 1;
            num_3 = div + 1;
            num_4 = div;
            num_5 = div;
            num_6 = div;
            num_7 = div;
            num_8 = div;
            num_9 = div;
        }
        else if (leavNumb == 4){
            num_1 = div + 1;
            num_2 = div + 1;
            num_3 = div + 1;
            num_4 = div + 1;
            num_5 = div;
            num_6 = div;
            num_7 = div;
            num_8 = div;
            num_9 = div;
        }
        else if (leavNumb == 5){
            num_1 = div + 1;
            num_2 = div + 1;
            num_3 = div + 1;
            num_4 = div + 1;
            num_5 = div + 1;
            num_6 = div;
            num_7 = div;
            num_8 = div;
            num_9 = div;
        }
        else if (leavNumb == 6){
            num_1 = div + 1;
            num_2 = div + 1;
            num_3 = div + 1;
            num_4 = div + 1;
            num_5 = div + 1;
            num_6 = div + 1;
            num_7 = div;
            num_8 = div;
            num_9 = div;
        }
        else if (leavNumb == 7){
            num_1 = div + 1;
            num_2 = div + 1;
            num_3 = div + 1;
            num_4 = div + 1;
            num_5 = div + 1;
            num_6 = div + 1;
            num_7 = div + 1;
            num_8 = div;
            num_9 = div;
        }
        else if (leavNumb == 8){
            num_1 = div + 1;
            num_2 = div + 1;
            num_3 = div + 1;
            num_4 = div + 1;
            num_5 = div + 1;
            num_6 = div + 1;
            num_7 = div + 1;
            num_8 = div + 1;
            num_9 = div;
        }
        else if (leavNumb == 9){
            num_1 = div + 1;
            num_2 = div + 1;
            num_3 = div + 1;
            num_4 = div + 1;
            num_5 = div + 1;
            num_6 = div + 1;
            num_7 = div + 1;
            num_8 = div + 1;
            num_9 = div + 1;
        }
        else if (leavNumb == 0){
            num_0 = div;
            num_1 = div;
            num_2 = div;
            num_3 = div;
            num_4 = div;
            num_5 = div;
            num_6 = div;
            num_7 = div;
            num_8 = div;
            num_9 = div;
        }
        console.log(div +"  "+ leavNumb)
        console.log("0:"+num_0 +"  1:"+num_1+"  2:"+num_2 +"  3:"+num_3+"   4:"+num_4 +"  5:"+num_5+"   6:"+num_6 +"  7:"+num_7+"  8:"+num_8+"  9:"+num_9);
    }
</script>
</html>